<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../layui/css/layui.css">
</head>
<body>
<form class="layui-form"  >
    <div class="layui-inline" style="margin-top: 20px;">
        <label class="layui-form-label">教职工号：</label>
        <div class="layui-input-block">
            <input type="text" id="tno" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">姓名：</label>
        <div class="layui-input-block">
            <input type="text" id="tname" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">默认密码：</label>
        <div class="layui-input-block">
            <input type="text" id="password" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div style="margin-top: 20px;margin-left: 70px">
        <button type="button" id="tijiao" lay-submit lay-filter="formDemo" CLASS="layui-btn tijiao">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>

    </div>

</form>
</body><script src="../layui/layui.js" charset="utf-8"></script>
<script src="../js/jquery.min.js"></script>
<script type="text/javascript">
    layui.use('laydate', function() {
        let laydate = layui.laydate;

        //常规用法
        laydate.render({
            elem: '#date'
            ,trigger: 'click'
        });
    });

</script>
<script>
    $(".tijiao").click(function () {
        $.ajax({
            url: "/teacher/xinZeng",
            method: "post",
            contentType: "application/json",
            data: JSON.stringify({
                tno: $("#tno").val(),
                tname: $("#tname").val(),
                tpassword: $("#password").val(),
                statue:"start"
            }),
            success: function (res) {
                if (res.code == 200) {
                    alert("添加成功！！！");

                } else {
                    alert("添加失败！！！")
                }



            }

        })
    });

</script>
</html>